package com.eascs.admin.o2o.oper.dao;

import org.springframework.stereotype.Repository;

import com.eascs.admin.common.dao.BaseO2oDao;
import com.eascs.admin.o2o.oper.entity.O2oOperUpEntity;
import com.eascs.admin.o2o.oper.vo.O2oOperUpVo;
import com.eascs.app.dao.PageResult;
import com.eascs.app.dao.SqlPageQuery;

@Repository
public class O2oOperUpDao extends BaseO2oDao {

	public int udpateOper(O2oOperUpEntity o2oOperUpEntity) {
		return this.updateById(o2oOperUpEntity);
	}

	public int addOper(O2oOperUpEntity o2oOperUpEntity) {
		return this.insert(o2oOperUpEntity);
	}

	public O2oOperUpEntity queryOperUpByLoanapplyNo(String loanapplyNo) {
		String sql = "select * from o2o_update_op_log where loanapply_no=?";
		return this.findEntity(sql, O2oOperUpEntity.class, loanapplyNo);
	}
	
	public PageResult<Object[]> queryOperUp(O2oOperUpVo operUpVo) {
		SqlPageQuery<Object[]> sqlPageQuery = new SqlPageQuery<>(Object[].class, operUpVo.getPageSize(), operUpVo.getO2oIndex());
		
		return this.findDataWithPage(sqlPageQuery);
	}
}
